<!DOCTYPE html>
<html>
  <%= head(inline_assets) %>
  <body>

    <%= header(scenario.input_name) %>

    <%= render_system_info(system) %>

    <%= if Scenario.data_processed?(scenario, :run_time) do %>
      <article>
        <h2>
          <a name="run_time" href="#run_time"><%= scenario.name %> Run Time</a>
          <a href="https://github.com/PragTob/benchee_html/wiki/Chart-Types#individual">
            <i
              class="benchee-help-icon icon-question-circle-o"
              title="Graphs showing the individual run time distribution for <%= scenario.name %>.
  Run Times Histogram shows the distribution of occurrences of specific run times in buckets.
  Raw Run Times shows all individual recorded run times in the order they were recorded in."
            ></i>
          </a>
        </h2>

        <section>
          <%= render_data_table(scenario, :run_time_data, units) %>
        </section>

        <section class="benchee-plot-container">
          <div id="run-times-histogram" class="plot"></div>
        </section>
        <section class="benchee-plot-container">
          <div id="raw-run-times" class="plot"></div>
        </section>
      </article>
    <% end %>

    <%= if Scenario.data_processed?(scenario, :memory) do %>
      <article>
        <h2>
          <a name="memory" href="#memory"><%= scenario.name %> Memory</a>
          <a href="https://github.com/PragTob/benchee_html/wiki/Chart-Types#individual">
            <i
              class="benchee-help-icon icon-question-circle-o"
              title="Graphs showing the individual memory usage distribution for <%= scenario.name %>.
  Run Times Histogram shows the distribution of occurrences of specific run times in buckets.
  Raw Run Times shows all individual recorded run times in the order they were recorded in."
            ></i>
          </a>
        </h2>

        <section>
          <%= render_data_table(scenario, :memory_usage_data, units) %>
        </section>

        <%= if scenario.memory_usage_data.statistics.std_dev != 0 do %>
          <section class="benchee-plot-container">
            <div id="memory-histogram" class="plot"></div>
          </section>
          <section class="benchee-plot-container">
            <div id="raw-memory" class="plot"></div>
          </section>
        <% end %>
      </article>
    <% end %>

    <footer>
      <%= render_footer() %>
    </footer>

    <%= js_includes(inline_assets) %>

    <script>
      var scenario = <%= scenario_json %>;

      var inputHeadline = "<%= input_headline(scenario.input_name) %>"

      <%= if Scenario.data_processed?(scenario, :run_time) do %>
        drawRunTimeHistogram(scenario, inputHeadline);
        drawRawRunTimeChart(scenario, inputHeadline);
      <% end %>

      <%= if Scenario.data_processed?(scenario, :memory) do %>
        if (scenario.memory_usage_data.statistics.std_dev !== 0) {
          drawMemoryHistogram(scenario, inputHeadline);
          drawRawMemoryChart(scenario, inputHeadline);
        };
      <% end %>
    </script>
  </body>
</html>
